//浮游、底栖生物输入验证
$().ready(function() {
// 在键盘按下并释放及提交后验证提交表单
//监测点输入验证
	  $("#monitsite_check").validate({
		    rules: {
		    	
		    	Institution: {
		    		required:true,
		        maxlength: 60,
		    	},
		    	Investigator: {
		    		required:true,
			        maxlength: 40,
			    },
			    Site: {
			    	required:true,
			        maxlength: 200,
			    },
			    River: {
			    	required:true,
			        maxlength: 20,
			    },	         
			    	StartLongitude: {
				        number: true,
				        maxlength: 13,
				        range: [-180,+180],
				    },
				    StartLatitude: {
				        number: true,
				        maxlength: 12,
				        range: [-90,+90],
				    },
				    EndLongitude: {
				        number: true,
				        maxlength: 13,
				        range: [-180,+180],
				    },
				    EndLatitude: {
				        number: true,
				        maxlength: 12,
				        range: [-90,+90],
				    },
				    Weather: {
				        maxlength: 4,
				    },
				    Temperature: {
				        number: true,
				        rangelength: [2,5],
				    },
	  
		      },
		    messages: {
		      Institution: {
			        maxlength: "输入数据超过60",
			    	},
			    	Investigator: {
				        maxlength: "输入数据超过40",
				    },
				    Site: {
				        maxlength: "输入数据超过200",
				    },
				    River: {
				        maxlength: "输入数据超过20",
				    },	         
				    	StartLongitude: {
					        number: "数据格式错误",
					        maxlength: "数据长度错误",
					        range: "数据范围错误",
					    },
					    StartLatitude: {
					        number: "数据格式错误",
					        maxlength: "数据长度错误",
					        range: "数据范围错误",
					    },
					    EndLongitude: {
				        number: "数据格式错误",
				        maxlength: "数据长度错误",
				        range: "数据范围错误",
					    },
					    EndLatitude: {
					        number: "数据格式错误",
					        maxlength: "数据长度错误",
					        range: "数据范围错误",
					    },
					    Weather: {
					        maxlength: "输入数据超过4",
					    },
					    Temperature: {
					        number: "数据格式错误",
					        rangelength: "数据长度错误",
					    },
	          },
});

//单群体表输入验证
    $("#testColony").validate({
        rules:{
            sampleNum:{
                required:true,
                number:true,
            },
            dataType:{
                required:true,
            },
            numSimple:{
                number:true,
			},
            totalNum:{
                number:true,
			},
            NumAllele:{
                number:true,
			}
        },
        messages:{
            sampleNum:{
                required:"不能为空",
                number: "必须为数字",
            },
            dataType:{
                required:"不能为空",
            },
            numSimple:{
                number:"必须为数字",
            },
            totalNum:{
                number:"必须为数字",
            },
            NumAllele:{
                number:"必须为数字",
            }
        }
    });
    $("#danqunti").validate({
        rules:{
            dqt1:{
                required:true,
                number:true,
            },
            dqt3:{
                required:true,
            },
            dqt4:{
                number:true,
            },
            dqt5:{
                number:true,
            },
            dqt8:{
                number:true,
            }
        },
        messages:{
            dqt1:{
                required:"不能为空",
                number: "必须为数字",
            },
            dqt3:{
                required:"不能为空",
            },
            dqt4:{
                number:"必须为数字",
            },
            dqt5:{
                number:"必须为数字",
            },
            dqt8:{
                number:"必须为数字",
            }
        }
    });
//  断面输入验证
  $("#surface_check").validate({
	    rules: {
	    	Distance2Bank2: {
	        number: true,
	        rangelength: [1,10],
	      },
	      
	      
	    },
	    messages: {
	      Distance2Bank2: {
	        number: "必须为数字",
	        rangelength:"数据长度错误",
	      },
	      
	    }
	});
  
//浮游、底栖生物输入验证
  $("#feature_check").validate({
	    rules: {
	    	Quality: {
	        number: true,
	        rangelength: [1,10],
	      },
	      	Biomass: {
		    number: true,
		    rangelength: [1,5],
		   },
	      
	    },
	    messages: {
	    Quality: {
	        number: "必须为数字",
	        rangelength:"数据长度错误",
	      },
	    Biomass: {
		    number: "必须为数字",
		    rangelength:"数据长度错误",
	      },
	    }
	});
  
//优势浮游、底栖生物输入验证
  $("#pfeature_check").validate({
	    rules: {
	    	Name: {
		        maxlength: 30,
		      },
	    	Quality: {
	        number: true,
	        rangelength: [1,10],
	      },
	      	Biomass: {
		    number: true,
		    rangelength: [1,5],
		   },
	      
	    },
	    messages: {
	    	Name: {
		        maxlength:"数据长度错误",
		      },
	    Quality: {
	        number: "必须为数字",
	        rangelength:"数据长度错误",
	      },
	    Biomass: {
		    number: "必须为数字",
		    rangelength:"数据长度错误",
	      },
	    }
	    
	});
  //水质监测表
    $("#testDetection").validate({
        rules: {
            indexNumber: {
				required:true,
                number: true,
            },
            indexValue: {
                number: true,
            }
        },
        messages: {
            indexNumber: {
                required:"不能为空",
                number: "必须为数字",
            },
            indexValue: {
                number: "必须为数字",
            }
        }

    });
    $("#shuizhijiance").validate({
        rules: {
            sz1: {
                required:true,
                number: true,
            },
            sz3: {
                number: true,
            }
        },
        messages: {
            sz1: {
                required:"不能为空",
                number: "必须为数字",
            },
            sz3: {
                number: "必须为数字",
            }
        }

    });
  //鱼污染物的验证
    $("#testFishEP").validate({
        rules:{
            indexID:{
                number:true,
                required:true,
            },
            indexValue:{
                number:true,
            }
        },
        messages:{
            indexID:{
                number: "必须为数字",
                required:"不能为空",
            },
            indexValue:{
                number: "必须为数字",
            }
        }
    });
    $("#yuwuranbiao").validate({
        rules:{
            indexValue:{
                number:true,

            }

        },
        messages:{
            indexValue:{
                number: "必须为数字",
            }
        }
    });
  //采样水层的验证
    $("#testWLE").validate({
	 
	  rules:{
		  Depth:{
			  required:true,
			  number:true,
			  rangelength:[2,5],
		  },
		  Temperature:{
			  required:true,
			  number:true,
			  rangelength:[2,5],
		  },
		  WaterLevel:{
			  required:true,
			  number:true,
			  rangelength:[2,5],
		  },
		  Velocity:{
			  required:true,
			  number:true,
			  rangelength:[2,10],
		  }  
		  
	  },
	  messages:{
		  Depth:{
			  required:"不能为空",
			  number: "必须为数字",
			  rangelength:"数据长度错误",
		  },
		  Temperature:{
			  required:"不能为空",
			  number: "必须为数字",
			  rangelength:"数据长度错误",
		  },
		  WaterLevel:{
			  required:"不能为空",
			  number: "必须为数字",
			  rangelength:"数据长度错误",
		  },
		  Velocity:{
			  required:"不能为空",
			  number: "必须为数字",
			  rangelength:"数据长度错误",
		  }
	  }
	  
	  
  });
    $("#caiyangshuiceng1").validate({

        rules:{
            cy11:{
                required:true,
                number:true,
                rangelength:[2,5],
            },
            cy12:{
                required:true,
                number:true,
                rangelength:[2,5],
            },
            cy13:{
                required:true,
                number:true,
                rangelength:[2,5],
            },
            cy14:{
                required:true,
                number:true,
                rangelength:[2,10],
            }

        },
        messages:{
            cy11:{
                required:"不能为空",
                number: "必须为数字",
                rangelength:"数据长度错误",
            },
            cy12:{
                required:"不能为空",
                number: "必须为数字",
                rangelength:"数据长度错误",
            },
            cy13:{
                required:"不能为空",
                number: "必须为数字",
                rangelength:"数据长度错误",
            },
            cy14:{
                required:"不能为空",
                number: "必须为数字",
                rangelength:"数据长度错误",
            }
        }


    });
    $("#caiyangshuiceng2").validate({

        rules:{
            cy21:{
                required:true,
                number:true,
                rangelength:[2,5],
            },
            cy22:{
                required:true,
                number:true,
                rangelength:[2,5],
            },
            cy23:{
                required:true,
                number:true,
                rangelength:[2,5],
            },
            cy24:{
                required:true,
                number:true,
                rangelength:[2,10],
            }

        },
        messages:{
            cy21:{
                required:"不能为空",
                number: "必须为数字",
                rangelength:"数据长度错误",
            },
            cy22:{
                required:"不能为空",
                number: "必须为数字",
                rangelength:"数据长度错误",
            },
            cy23:{
                required:"不能为空",
                number: "必须为数字",
                rangelength:"数据长度错误",
            },
            cy24:{
                required:"不能为空",
                number: "必须为数字",
                rangelength:"数据长度错误",
            }
        }


    });
    $("#caiyangshuiceng3").validate({

        rules:{
            cy31:{
                required:true,
                number:true,
                rangelength:[2,5],
            },
            cy32:{
                required:true,
                number:true,
                rangelength:[2,5],
            },
            cy33:{
                required:true,
                number:true,
                rangelength:[2,5],
            },
            cy34:{
                required:true,
                number:true,
                rangelength:[2,10],
            }

        },
        messages:{
            cy31:{
                required:"不能为空",
                number: "必须为数字",
                rangelength:"数据长度错误",
            },
            cy32:{
                required:"不能为空",
                number: "必须为数字",
                rangelength:"数据长度错误",
            },
            cy33:{
                required:"不能为空",
                number: "必须为数字",
                rangelength:"数据长度错误",
            },
            cy34:{
                required:"不能为空",
                number: "必须为数字",
                rangelength:"数据长度错误",
            }
        }


    });
    $("#caiyangshuiceng4").validate({

        rules:{
            cy41:{
                required:true,
                number:true,
                rangelength:[2,5],
            },
            cy42:{
                required:true,
                number:true,
                rangelength:[2,5],
            },
            cy43:{
                required:true,
                number:true,
                rangelength:[2,5],
            },
            cy44:{
                required:true,
                number:true,
                rangelength:[2,10],
            }

        },
        messages:{
            cy41:{
                required:"不能为空",
                number: "必须为数字",
                rangelength:"数据长度错误",
            },
            cy42:{
                required:"不能为空",
                number: "必须为数字",
                rangelength:"数据长度错误",
            },
            cy43:{
                required:"不能为空",
                number: "必须为数字",
                rangelength:"数据长度错误",
            },
            cy44:{
                required:"不能为空",
                number: "必须为数字",
                rangelength:"数据长度错误",
            }
        }


    });
  //卵样本检验
    $("#luanyangben").validate({
        rules:{
            lyb2:{
                required:true,
                number:true,
                rangelength:[2,10],
            },
            lyb3:{
                required:true,
                number:true,
                rangelength:[2,10],
            },
            lyb4:{
                maxlength:100,
            },
            lyb5:{
                maxlength:100,
            }
        },
        messages:{
            lyb2:{
                required:"不能为空",
                number: "必须为数字",
                rangelength:"数据长度错误",
            },
            lyb3:{
                required:"不能为空",
                number: "必须为数字",
                rangelength:"数据长度错误",
            },
            lyb4:{
                maxlength:"最大长度为100",
            },
            lyb5:{
                maxlength:"最大长度为100",
            }
        }

    });
  $("#testFishEggs").validate({
	  rules:{
		  Diameter:{
			  required:true,
			  number:true,
			  rangelength:[2,10],
		  },
		  EMDiameter:{
			  required:true,
			  number:true,
			  rangelength:[2,10],
		  },
		  PigmentProp:{
			  maxlength:100,
		  },
		  EmbryoProp:{
			  maxlength:100, 
		  }
	  },
	  messages:{
		  Diameter:{
			  required:"不能为空",
			  number: "必须为数字",
			  rangelength:"数据长度错误",
		  },
		  EMDiameter:{
			  required:"不能为空",
			  number: "必须为数字",
			  rangelength:"数据长度错误",
		  },
		  PigmentProp:{
			  maxlength:"最大长度为100",
		  },
		  EmbryoProp:{
			  maxlength:"最大长度为100",
		  }
	  }
	  
  });
  //鱼样本验证
    $("#yuyangben").validate({
        rules:{
            yyb1:{
                number:true,
                maxlength:10,
            },
            yyb2:{
                number:true,
                maxlength:10,
            },
            yyb3:{
                number:true,
                rangelength:[1,10],
            },
            yyb4:{
                number:true,
                maxlength:2,
            },
            yyb5:{
                number:true,
            },
            yyb6:{
                number:true,
            },
            yyb7:{
                number:true,
            },
            yyb8:{
                number:true,
            },
            yyb9:{
                number:true,
            },
            yyb10:{
                number:true,
            }
        },
        messages:{
            yyb1:{
                number:"必须为数字",
                maxlength:"最大长度为10",
            },
            yyb2:{
                number:"必须为数字",
                maxlength:"最大长度为10",
            },
            yyb3:{
                number: "必须为数字",
                rangelength:"数据长度错误"
            },
            yyb4:{
                number:"必须为数字",
                maxlength:"最大长度为2",
            },
            yyb5:{
                number:"必须为数字",
            },
            yyb6:{
                number:"必须为数字",
            },
            yyb7:{
                number: "必须为数字",
            },
            yyb8:{
                number:"必须为数字",
            },
            yyb9:{
                number: "必须为数字",
            },
            yyb10:{
                number:"必须为数字",
            }
        }

    });
     $("#testFishes").validate({
	  rules:{
		  BodyLength:{
			  number:true,
			  maxlength:10,
		  },
		  Length:{
			  number:true,
			  maxlength:10,
		  },
		  BodyWeight:{
			  required:true,
			  number:true,
			  rangelength:[1,10],
		  },
		  Age:{
			  number:true,
			  maxlength:2,
		  }
	  },
	  messages:{
		  BodyLength:{
			  number:"必须为数字",
			  maxlength:"最大长度为10",
		  },
		  Length:{
			  number:"必须为数字",
			  maxlength:"最大长度为10",
		  },
		  BodyWeight:{
			  required:"不能为空",
			  number: "必须为数字",
			  rangelength:"数据长度错误"
		  },
		  Age:{
			  number:"必须为数字",
			  maxlength:"最大长度为2",
		  }
	  }
	  
  });
  
  $("#testGet").validate({
	  rules:{
		  Name:{
			  maxlength:30,
		  },
		  TotalQuality:{
			  number:true,
			  rangelength:[0,8],
		  },
		  EggQuality:{
			  number:true,
			  rangelength:[0,8],
		  },
		  FryQuality:{
			  number:true,
			  rangelength:[0,8],
		  }
	  },
	  messages:{
		  Name:{
			  maxlength:"最大为30个字符",
		  },
		  TotalQuality:{
			  number:"必须为数字",
			  rangelength:"最大长度为8",
		  },
		  EggQuality:{
			  number:"必须为数字",
			  rangelength:"最大长度为8",
		  },
		  FryQuality:{
			  number:"必须为数字",
			  rangelength:"最大长度为8",
		  }
	  }
  });

    $("#yuhuowu").validate({
        rules:{
            yhw1:{
                required:true,
                maxlength:30,
            },
            yhw2:{
                number:true,
                rangelength:[0,8],
            },
            yhw3:{
                number:true,
                rangelength:[0,8],
            },
            yhw4:{
                number:true,
                rangelength:[0,8],
            }
        },
        messages:{
            yhw1:{
                required:"不能为空",
                maxlength:"最大为30个字符",
            },
            yhw2:{
                number:"必须为数字",
                rangelength:"最大长度为8",
            },
            yhw3:{
                number:"必须为数字",
                rangelength:"最大长度为8",
            },
            yhw4:{
                number:"必须为数字",
                rangelength:"最大长度为8",
            }
        }
    });
  //网具验证
  	$("#testTool").validate({
	 rules:{
		 Name:{
			 maxlength:40,
		 },
		 NetsModel:{
			 maxlength:8,
		 },
		 NetMouthArea:{
			 required:true,
			 number:true,
			 rangelength:[3,10],
		 },
		 NetMouthDip:{
			 number:true,
			 maxlength:3,
		 },
		 NetMouthVelocity:{
			 required:true,
			 number:true,
			 rangelength:[3,10],
		 }
	 },
		 messages:{
			 Name:{
				 maxlength:"最大长度为40",
			 },
			 NetsModel:{
				 maxlength:"最大长度为8",
			 },
			 NetMouthArea:{
				  required:"不能为空",
				  number: "必须为数字",
				  rangelength:"数据长度至少为3"
			 },
			 NetMouthDip:{
				  number:"必须为数字",
				  maxlength:"最大长度为3",
			 },
			 NetMouthVelocity:{
				  required:"不能为空",
				  number: "必须为数字",
				  rangelength:"数据长度至少为3"
			 }
		 }
		 
		 
	 });
    $("#wangju").validate({
        rules:{
            wj1:{
                maxlength:40,
            },
            wj2:{
                maxlength:8,
            },
            wj3:{
                required:true,
                number:true,
                rangelength:[3,10],
            },
            wj4:{
                number:true,
                maxlength:3,
            },
            wj7:{
                required:true,
                number:true,
                rangelength:[3,10],
            }
        },
        messages:{
            wj1:{
                maxlength:"最大长度为40",
            },
            wj2:{
                maxlength:"最大长度为8",
            },
            wj3:{
                required:"不能为空",
                number: "必须为数字",
                rangelength:"数据长度至少为3"
            },
            wj4:{
                number:"必须为数字",
                maxlength:"最大长度为3",
            },
            wj7:{
                required:"不能为空",
                number: "必须为数字",
                rangelength:"数据长度至少为3"
            }
        }


    });

    $("#testTool1").validate({
        rules:{
            Name:{
                maxlength:40,
            },
            NetsModel:{
                maxlength:8,
            },
            NetMouthArea:{
                required:true,
                number:true,
                rangelength:[3,10],
            },
            NetMouthDip:{
                number:true,
                maxlength:3,
            },
            NetMouthVelocity:{
                required:true,
                number:true,
                rangelength:[3,10],
            }
        },
        messages:{
            Name:{
                maxlength:"最大长度为40",
            },
            NetsModel:{
                maxlength:"最大长度为8",
            },
            NetMouthArea:{
                required:"不能为空",
                number: "必须为数字",
                rangelength:"数据长度至少为3"
            },
            NetMouthDip:{
                number:"必须为数字",
                maxlength:"最大长度为3",
            },
            NetMouthVelocity:{
                required:"不能为空",
                number: "必须为数字",
                rangelength:"数据长度至少为3"
            }
        }


    });
  
});